$tag @n[distance=..15,nbt={UUID:$(target)}] add target

function vs:system/game_ctrol/guard_tower/ai/attack/consume_power
execute facing entity @n[tag=target,distance=..15] eyes positioned ^ ^ ^0.1 run function vs:system/game_ctrol/guard_tower/ai/attack/-l/loop
playsound minecraft:entity.bee.sting master @a ~ ~ ~ 1.0 2.0

tag @n[tag=target] remove target